package com.tedu.springdemo.day04;

import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Lazy
//@Scope("prototype")
@Component
public class UserDao {
    @PostConstruct
    public void myInit(){
        System.out.println("获取数据库链接。。。");
    }

    public void addUser(){
        System.out.println("创建新用户。。。");
    }

    public void updateUser(){
        System.out.println("修改用户信息");
    }
    @PreDestroy
    public void myDestroy(){
        System.out.println("释放数据库。。。");
    }
}
